/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * leafget
 * Copyright (C) xinliGG 2008 <xinliGG@gmail.com>
 * 
 * leafget is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * leafget is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _NEW_H_
#define _NEW_H_

#include <gtkmm/alignment.h>
#include <gtkmm/box.h>
#include <gtkmm/button.h>
#include <gtkmm/dialog.h>
#include <gtkmm/entry.h>
#include <gtkmm/filechooserdialog.h>
#include <gtkmm/frame.h>
#include <gtkmm/label.h>
#include <gtkmm/radiobutton.h>
#include <gtkmm/window.h>

#include <string>

#include "leafget.h"
 
class New: public Gtk::Dialog 
{
public:

	New ( Gtk::Window &, const LEAF_CONFIG_DATA & );
	virtual ~New ( void ) {};
	
		/* set functions */
	
	void set_url   ( const std::string & );
	
		/* get functions */
	
	const std::string get_url   ( void ) const;
	const std::string get_dir   ( void ) const;
	const std::string get_name  ( void ) const;
	const std::string get_user  ( void ) const;
	const std::string get_pass  ( void ) const;
	const bool        get_start ( void ) const;

private:

		/* set functions */

	void set_start ( const bool & );
 
 		/* events */
 
	virtual void on_changed_url       ( void );
	virtual void on_button_folder_new ( void );

		/* ftp */

	const std::string &defaultPass;

		/* widgets */

	Gtk::VBox *newBox;
	Gtk::VBox  boxFrameFile;
	Gtk::VBox  boxFrameFTP;

	Gtk::HBox boxURL;
	Gtk::HBox boxDir;
	Gtk::HBox boxName;
	Gtk::HBox boxUser;
	Gtk::HBox boxPass;
	Gtk::HBox boxRadio;

	Gtk::Frame FrameFile;
	Gtk::Frame FrameFTP;
	Gtk::Frame FrameStartOptions;

	Gtk::Label LabelURL;
	Gtk::Label LabelDir;
	Gtk::Label LabelName;
	Gtk::Label LabelUser;
	Gtk::Label LabelPass;

	Gtk::Entry EntryURL;
	Gtk::Entry EntryDir;
	Gtk::Entry EntryName;
	Gtk::Entry EntryUser;
	Gtk::Entry EntryPass;

	Gtk::Button Button_Folder;

	Gtk::RadioButton        RadioButtonOn;
	Gtk::RadioButton        RadioButtonOff;
	Gtk::RadioButton::Group group;

	Gtk::Alignment          AlignmentRadio;

};

#endif // _NEW_H_
